<?php
  include("../conn.php");
  $sql = "SELECT * FROM `swiper` where `validity` = 1 order by id desc";
  $query = mysql_query($sql);
  while ($rs = mysql_fetch_array($query)) $swiper[] = array(
    'id' => $rs['id'],
    'image' => $rs['image'],
    'url' => $rs['url']
  );
  mysql_close($link);
  print_r(json_encode($swiper));
?>
